package com.wanxi.servlet.company;//package com.wanxi.servlet.company;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.wanxi.model.ClothingStyleModel;
//import com.wanxi.model.CompanyModel;
//import com.wanxi.model.ResultModel;
//import com.wanxi.service.ClothingStyleService;
//import com.wanxi.service.CompanyService;
//import com.wanxi.service.impl.ClothingStyleServiceImpl;
//import com.wanxi.service.impl.CompanyServiceImpl;
//import com.wanxi.util.Tool;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//@WebServlet("/back/company/add")
//public class CompanyAddServlet extends HttpServlet {
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
////        1.乱码处理
////        req.setCharacterEncoding("UTF-8");
////        resp.setCharacterEncoding("UTF-8");
////        2.获取前端的值
//        String phone = req.getParameter("phone");
//        String isShow = req.getParameter("isShow");
//        String qq = req.getParameter("qq");
//        String email = req.getParameter("email");
//        String code = req.getParameter("code");
//        String address = req.getParameter("address");
//
////        3.封装到model
//        CompanyModel companyModel = new CompanyModel();
//        companyModel.setPhone(Tool.nullToStr(phone));
//        companyModel.setIsShow(Tool.strToInt(isShow));
//        companyModel.setQq(Tool.strToInt(qq));
//        companyModel.setEmail(Tool.nullToStr(email));
//        companyModel.setCode(Tool.nullToStr(code));
//        companyModel.setAddress(Tool.nullToStr(address));
////        4.调用service
//        CompanyService companyService=new CompanyServiceImpl();
////        5.得到返回值
//        ResultModel resultModel =companyService.add(companyModel);
////        6.返回给前端
//        resp.getWriter().println(JSONObject.toJSONString(resultModel));
//    }
//}
